Skip to content

fix(backend): correct amortization schedule and total due interest ca… - #1575

Merged
ogazboiz merged 2 commits into
LabsCrypt:mainfrom
extolkom:fix/1371-amortization-total-due
Aug 3, 2026
Merged

fix(backend): correct amortization schedule and total due interest ca…#1575
ogazboiz merged 2 commits into
LabsCrypt:mainfrom
extolkom:fix/1371-amortization-total-due

Conversation

@extolkom

Copy link
Copy Markdown
Contributor

closes #1371

Fixes #1371 — amortization total due was understated by all interest.

  • backend/src/controllers/loanController.ts: fixed getLoanDetails totalOwed to principal + accruedInterest - totalRepaid, and ensured buildAmortizationSchedule returns totalDue = principal + totalInterest
  • backend/src/__tests__/loanEndpoints.test.ts: added regression assertions for totalOwed and amortization totalDue

Verification: npm run typecheck ✅, npm test ✅, npm run build ✅.

…lculation (LabsCrypt#1371)

Ensure total due and total owed include accrued interest instead of subtracting it in backend/src/controllers/loanController.ts (buildAmortizationSchedule & getLoanDetails).

@ogazboiz ogazboiz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good work. the totalOwed fix (accrued interest added instead of subtracted) is correct and the two regression assertions are exactly the guards we want. note the buildAmortizationSchedule half of #1371 had already landed on main, so this effectively closes #1369 with test coverage for both identities. CI green after rebase. merging.

if you want to keep contributing, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0

@ogazboiz
ogazboiz merged commit 51b68e1 into LabsCrypt:main Aug 3, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Amortization total due is understated by all interest

2 participants